import request from '@/api/request'
const token = localStorage.getItem('token')
export const userInfo = ({ currentPage, pageSize, paramsString }) => {
  let queryString = paramsString

  if (paramsString === '男') {
    queryString = 1
  } else if (paramsString === '女') {
    queryString = 0
  }
  return request({
    url: `/user/info/${currentPage}/${pageSize}`,
    method: 'GET',
    params: {
      queryString
    },
    headers: {
      Authorization: `Bearer ${token}`
    }
  })
}

export const adminInfo = ({ currentPage, pageSize, queryString }) => {
  return request({
    url: `/user/adminInfo/${currentPage}/${pageSize}`,
    method: 'GET',
    params: {
      queryString
    },
    headers: {
      accept: 'application/json',
      Authorization: `Bearer ${token}`
    }
  })
}
